function Y=applyHFilter2D(X,Hhat)
%
% Apply the convolution filter that corresponds to the gram operator of the
% pseudo-polar Fourier transform to the volume X.
%
% X should be a volume of size nxnxn, and H should be a convolution filter
% for size n, as generared by makeppftfilter(n).
%
% Yoel Shkolnisky, December 2010.

verifyImage2D(X);
n=size(X,1);
L=3*n-2; %n+2n-1-1
%Hhat=fftn(H.filter,[L L]);
Xhat=fftn(X,[L L]);
Y=ifftn(Xhat.*Hhat,[L L]);
Y=Y(n:2*n-1,n:2*n-1);
